public class General<T>{

    private class Node (T T )
    {
        public T  Data {get;set;}=T;
        public Node ? Next {get;set;}
    }

    private Node ? head;

    public void AddHead(T t)
    {
        Node node = new (t);
        node.Next = head;
        head = node;
    }

    public IEnumerator<T> GetEnumerator()
    {
        Node ? current =head;

        while(current != null)
        {
            yield return current.Data;
            current = current.Next;
        }
    }
}